#include "ptitlebarplugin.h"

PTitleBarPlugin::PTitleBarPlugin(QObject *parent)
 : QObject(parent), QDesignerCustomWidgetInterface()
{
 initialized = false;
}


PTitleBarPlugin::~PTitleBarPlugin()
{
}


void PTitleBarPlugin::initialize(QDesignerFormEditorInterface * /* core */)
{
    if (initialized)
        return;

    initialized = true;
}

bool PTitleBarPlugin::isInitialized() const
{
    return initialized;
}

QWidget *PTitleBarPlugin::createWidget(QWidget *parent)
{
  return new PTitleBar(parent);
}

QString PTitleBarPlugin::name() const
{
    return "PTitleBar";
}

QString PTitleBarPlugin::group() const
{
    return "Pripares";
}

QIcon PTitleBarPlugin::icon() const
{
    return QIcon(":/rsc/pripares.png");
}

QString PTitleBarPlugin::toolTip() const
{
    return "PTitleBar";
}

QString PTitleBarPlugin::whatsThis() const
{
    return "";
}

bool PTitleBarPlugin::isContainer() const
{
    return false;
}

QString PTitleBarPlugin::domXml() const
{
    return "<widget class=\"PTitleBar\" name=\"titleBar\">\n"
           " <property name=\"geometry\">\n"
           "  <rect>\n"
           "   <x>0</x>\n"
           "   <y>0</y>\n"
           "   <width>100</width>\n"
           "   <height>19</height>\n"
           "  </rect>\n"
           " </property>\n"
           " <property name=\"maximumSize\" >\n"
           "  <size>\n"
           "   <width>16777215</width>\n"
           "   <height>19</height>\n"
           "  </size>\n"
           " </property>\n"
           " <property name=\"titleBar\" >\n"
           "  <string>A custom title bar</string>\n"
           " </property>\n"
           " <property name=\"whatsThis\" >\n"
           "  <string>A custom title bar.</string>\n"
           " </property>\n"
           "</widget>\n";
           "<property name=\"titleString\" >\n"
           "   <string>\"Title Text\"<string/>\n"
           "</property>\n";
}

QString PTitleBarPlugin::includeFile() const
{
    return "ptitlebar.h";
}

QString PTitleBarPlugin::codeTemplate() const
{
    return "";
}

//Q_EXPORT_PLUGIN(PTitleBarPlugin)
Q_EXPORT_PLUGIN2(PTitleBar, PTitleBarPlugin)